﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Foreach
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] names = new string[3] { "lida", "tom", "lucy" };

            foreach (string str in names)
            {
                Console.WriteLine(str);
            }

            //int[] nums = new int[3] { 0, 1, 2 };
            int[] nums = { 0, 2, 3 };
            
            //依次便利nums中的每一个元素
            foreach (int i in nums)
            {
                Console.WriteLine(i);
            }

            Console.ReadKey();
        }
    }
}
